﻿using DentScan2.DB;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace DentScan2.WebApp.Classes
{
    public class DetailPhoto
    {
        public Guid? PhotoId
        {
            get;
            set;
        }

        public DetailPhoto()
        {
        }
        public DetailPhoto(DB.DetailPhoto detail)
        {
            this.PhotoId = detail.PhotoId;
        }

        public void SaveToDB(DLDataContext dl, Guid damageDetailId)
        {
            DB.DetailPhoto detail = new DB.DetailPhoto()
            {
                DamageDetailId = damageDetailId,
                DetailPhotoId = Guid.NewGuid(),
                PhotoId = this.PhotoId,
                IsDel = false,
                LastEditDate = DateTime.UtcNow
            };

            dl.DetailPhotos.InsertOnSubmit(detail);
            dl.SubmitChanges();
        }



    }
}